package de.upb.messerschmidt.set.entity;

import javax.jdo.annotations.IdGeneratorStrategy;
import javax.jdo.annotations.PersistenceCapable;
import javax.jdo.annotations.Persistent;
import javax.jdo.annotations.PrimaryKey;

import com.google.appengine.api.datastore.Key;

/**
 * A Room belongs to a Location and has got a roomNr (used as identifier) which
 * will be used for {@link Talk}s.
 * 
 * @author Tim Messerschmidt
 * 
 */

@PersistenceCapable(detachable = "true")
public class Room {
	@PrimaryKey
	@Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
	private Key key;
	@Persistent
	private String roomNr;
	@Persistent
	private Location location;

	/**
	 * Constructor for an Event's Room. It contains a roomNr and a topic
	 * 
	 * @param roomNr
	 *            Short individual description of the roomNr
	 * @param location
	 *            The Location the Room is in
	 */
	public Room(String roomNr, Location location) {
		this.roomNr = roomNr;
		this.location = location;
	}

	/**
	 * @return the key
	 */
	public Key getKey() {
		return key;
	}

	/**
	 * @return the roomNr
	 */
	public String getRoomNr() {
		return roomNr;
	}

	/**
	 * @return the location
	 */
	public Location getLocation() {
		return location;
	}

	/**
	 * @param location
	 *            the location to set
	 */
	public void setLocation(Location location) {
		this.location = location;
	}

	/**
	 * @param key
	 *            the key to set
	 */
	public void setKey(Key key) {
		this.key = key;
	}

	/**
	 * @param roomNr
	 *            the roomNr to set
	 */
	public void setRoomNr(String roomNr) {
		this.roomNr = roomNr;
	}
}
